﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Workbench.Shared
{
    public static class DictionaryExtensions
    {
        public static void AddToValueList<TKey, TValue>(this Dictionary<TKey, List<TValue>> dict, TKey key, TValue value)
        {
            List<TValue> list;
            if (!dict.TryGetValue(key, out list))
            {
                list = new List<TValue>();
                dict.Add(key, list);
            }
            list.Add(value);
        }
    }
}
